#include "startform.h"
#include "ui_startform.h"
#include "pdf_to_word_dialog.h"
#include <QDebug>

StartForm::StartForm(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::StartForm)
{
    ui->setupUi(this);
    QString appPath=qApp->applicationDirPath();

    ui->toolButtonPdf2Word->setText("PDF转换成Word");
   // ui->toolButtonPdf2Word->setIcon(QIcon("E:/project/test/03.PdfToWord/build-PdfToWord-Desktop_Qt_5_9_1_MSVC2015_64bit-Release/release/resource/pdf转word.png"));
   QString path= appPath+"/resource/pdf转word.png";
    ui->toolButtonPdf2Word->setIcon(QIcon(":/images/pdf2word"));
    ui->toolButtonPdf2Word->setIconSize(QSize(46, 54));
    ui->toolButtonPdf2Word->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);  // 图标在上

    ui->toolButtonCompressPdf->setText("压缩PDF");
   // ui->toolButtonCompressPdf->setIcon(QIcon(".png"));
    path= appPath+"/resource/压缩PDF.png";
     ui->toolButtonCompressPdf->setIcon(QIcon(":/images/yasuo.png"));
    ui->toolButtonCompressPdf->setIconSize(QSize(46, 54));
    ui->toolButtonCompressPdf->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);  // 图标在上

    ui->toolButtonDocument2Pdf->setText("文档转换成PDF");
    //ui->toolButtonDocument2Pdf->setIcon(QIcon("C:\\Users\\28769\\Downloads\\pdf.png"));
    path= appPath+"/resource/pdf.png";
     ui->toolButtonDocument2Pdf->setIcon(QIcon(":/images/pdf2file.png"));
    ui->toolButtonDocument2Pdf->setIconSize(QSize(46, 54));
    ui->toolButtonDocument2Pdf->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);  // 图标在上

    ui->toolButtonEditPdf->setText("编辑PDF");
    //ui->toolButtonEditPdf->setIcon(QIcon("C:\\Users\\28769\\Downloads\\编辑.png"));
    path= appPath+"/resource/编辑.png";
     ui->toolButtonEditPdf->setIcon(QIcon(":/images/editpdf.png"));
    ui->toolButtonEditPdf->setIconSize(QSize(46, 54));
    ui->toolButtonEditPdf->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);  // 图标在上

    ui->toolButtonMergePdf->setText("合并PDF");
    //ui->toolButtonMergePdf->setIcon(QIcon("C:\\Users\\28769\\Downloads\\合并PDF.png"));
    path= appPath+"/resource/合并PDF.png";
     ui->toolButtonMergePdf->setIcon(QIcon(":/images/hebing.png"));
    ui->toolButtonMergePdf->setIconSize(QSize(46, 54));
    ui->toolButtonMergePdf->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);  // 图标在上

    ui->toolButtonOCR->setText("OCR");
    //ui->toolButtonOCR->setIcon(QIcon("C:\\Users\\28769\\Downloads\\OCR.png"));
    path= appPath+"/resource/OCR.png";
     ui->toolButtonOCR->setIcon(QIcon(":/images/ocr.png"));
    ui->toolButtonOCR->setIconSize(QSize(46, 54));
    ui->toolButtonOCR->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);  // 图标在上

    ui->toolButtonPdf2Photo->setText("PDF转成图片");
    //ui->toolButtonPdf2Photo->setIcon(QIcon("C:\\Users\\28769\\Downloads\\PDF2Photo.png"));
    path= appPath+"/resource/PDF2Photo.png";
     ui->toolButtonPdf2Photo->setIcon(QIcon(":/images/pdf2pic"));
    ui->toolButtonPdf2Photo->setIconSize(QSize(46, 54));
    ui->toolButtonPdf2Photo->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);  // 图标在上

    ui->toolButtonPhoto2Pdf->setText("图片转换成PDF");
    //ui->toolButtonPhoto2Pdf->setIcon(QIcon("C:\\Users\\28769\\Downloads\\图片转PDF.png"));
    path= appPath+"/resource/图片转PDF.png";
     ui->toolButtonPhoto2Pdf->setIcon(QIcon(":/images/jpg2pdf"));
    ui->toolButtonPhoto2Pdf->setIconSize(QSize(46, 54));
    ui->toolButtonPhoto2Pdf->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);  // 图标在上
}

StartForm::~StartForm()
{
    delete ui;
}

//转Pdf
void StartForm::on_toolButtonPdf2Word_clicked()
{
    PDF_To_Word_Dialog dlg;
    dlg.exec();
}
